import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  { path: '/login', component: () => import('@/views/user/Login') },
  { path: '/register', component: () => import('@/views/user/Register') },
  {
    path: '/',
    redirect: '/news',
    component: () => import('@/views/layout/Layout'),
    children: [
      { path: '/news', component: () => import('@/views/portal/field/NewsGrid') },
      { path: '/workpage', component: () => import('@/views/bpm/WorkPage') },
      { path: '/message', component: () => import('@/views/home/MessagePage') },
      { path: '/application', component: () => import('@/views/home/Application') },
      { path: '/personal', component: () => import('@/views/user/Personal') },
    ]
  },
  { path: '/readnews', component: () => import('@/views/portal/field/ReadNews') },
  //设置
  { path: '/setup', component: () => import('@/views/user/Setup') },
  //流程
  { path: '/process/:taskId', component: () => import('@/views/bpm/Process') },

  //配置404页面
  { path: '*', component: () => import('@/views/NotFound') }
]

const router = new VueRouter({
  mode: 'history',
  routes
})

export default router
